<template>
    <div>
        <el-form ref="form" :model="form" label-width="115px" :disabled="form.disabled">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="关联项目">
                        <el-input v-model="form.name">
                             <el-button slot="append" icon="el-icon-search" type="primary" @click="innerTableVisible =  true"></el-button>
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="管理单位">
                        <el-input v-model="form.guanlidanwei" :disabled='true'></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="24">
                    <el-divider></el-divider>
                </el-col>
                 <el-col :span="12">
                    <el-form-item label="方案编号">
                        <el-input v-model="form.code"></el-input>
                    </el-form-item>
                </el-col>

                <el-col :span="12">
                    <el-form-item label="抽查时间">
                        <el-input v-model="form.time"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="抽查结果" >
                         <el-select v-model="form.jieguo" placeholder="请选择">
                          <el-option
                            v-for="item in checkResultList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="抽查意见">
                        <el-input v-model="form.yijian"></el-input>
                    </el-form-item>
                </el-col>
                 <el-col :span="24">
                    <el-form-item label="附件">
                        <upload></upload>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="抽查单位">
                        <el-input v-model="form.chouchadanwei"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="操作员">
                        <el-input v-model="form.caozuoyuan"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <div  class="dialog-footer"v-if="!form.disabled">
                <el-button @click="saveEdit">取 消</el-button>
                <el-button type="primary" @click="saveEdit">确 定</el-button>
            </div>
        </el-form>

         <!-- 关联项目 -->
        <el-dialog title="关联项目" :visible.sync="innerTableVisible" width="80%" append-to-body>
            <projectTable @close="innerTableVisible = false" :form="form" :isComponent="true" type="planCheck"></projectTable>
        </el-dialog>
    </div>
</template>
<script>
import {GetFList} from '@/components/common/filter';
import projectTable from '../programSummarize';
export default {
    components: {
        projectTable
    },
    props: {
        editVisible: {
            default : false
        },
        form: {
            default: () => {},
        },
    },
    data() {
        return{
            checkResultList: GetFList('checkResult'),
            innerTableVisible: false
        }
    },
    methods: {
        saveEdit() {
            this.$emit('close')
        }
    }
}
</script>
<style scoped>
    .dialog-footer {
        text-align: right
    }
</style>